<!DOCTYPE html>
<html lang="en">
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Landing...</title>
  <link rel="stylesheet" th:href="@{/static/css/style.css}">
  <link th:href="@{/static/css/animate.css}" rel="stylesheet">
  <link th:href="@{/static/css/flat-ui.css}" rel="stylesheet">

</head>
<body>
  <div class="container">
    <div class="form-warp">
      <form class="sign-in-form" method="post" name="login" id="loginForm" action="/login">
        <span th:text="${loginReturnMsg}" style="color: #ff0000;margin-left: 75px"></span>
        <h2 class="form-title">登录</h2>
        <input placeholder="用户名"  name="userName" type="text" id="userName" value=""
               onkeyup="value=value.replace(/[\u4e00-\u9fa5]|(^\s+)|(\s+$)/ig,'')" />
        <input name="password"  value="" id="password" type="password" placeholder="密码"
               onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');"/>
        <div class="row">
          <div class="col-md-6">
            <label class="radio" for="radio1">
              <input type="radio"
                     name="type" value="0"
                     checked="checked"
                     id="radio1" data-toggle="radio"
                     class="custom-radio">
              <span class="icons"> <span class="icon-unchecked"></span>
											<span class="icon-checked"></span>
									</span> <font style="vertical-align: inherit;"> <font
                    style="vertical-align: inherit;"> 茶厂 </font>
            </font>
            </label>
          </div>

          <div class="col-md-6">
            <label class="radio" for="radio2">
              <input type="radio"
                     name="type" value="1"
                     id="radio2"
                     data-toggle="radio" class="custom-radio">
              <span
                      class="icons"> <span class="icon-unchecked"></span> <span
                      class="icon-checked"></span>
									</span> <font style="vertical-align: inherit;"> <font
                    style="vertical-align: inherit;"> 零售商 </font>
            </font>
            </label>
          </div>

          <div class="col-md-6">
            <label class="radio" for="radio3">
              <input type="radio"
                     name="type" value="2"
                     id="radio3"
                     data-toggle="radio" class="custom-radio">
              <span
                      class="icons"> <span class="icon-unchecked"></span> <span
                      class="icon-checked"></span>
									</span> <font style="vertical-align: inherit;"> <font
                    style="vertical-align: inherit;"> 消费者 </font>
            </font>
            </label>
          </div>
        </div>
        <input class="btn btn-primary btn-lg login-btn" value="立即登录"
               type="submit"/>
      </form>
    </div>

    <div class="desc-warp">
      <div class="desc-warp-smallproduct sign-up-desc">
        <div class="content">
          <H2>茶叶溯源管理系统</H2>
        </div>
        <img src="image/log.svg" alt="">
      </div>
    </div>
  </div>
  <script>
    $("#loginForm").submit(function () {
      //当表单提交的时候，对字段验证，并根据需要放出提示
      if ($.trim($("#userName").val()) == "") {
        alert("用户名不能为空");
        return false;//终止表单提交

      } else if ($.trim($("#password").val()) == "") {
        alert("密码不能为空");
        return false;//终止表单提交
      }
    });
  </script>
  <script th:src="@{/static/scripts/main.js}"></script>
</body>
</html>